package com.example.app2024.xigua;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.example.app2024.R;

import java.nio.channels.NonWritableChannelException;

public class xiguaActivity extends AppCompatActivity
{
      Button btn_login, btn_reg;

      @Override
      protected void onCreate(Bundle savedInstanceState)
      {
            super.onCreate(savedInstanceState);
            EdgeToEdge.enable(this);
            setContentView(R.layout.activity_xigua);
            ViewCompat.setOnApplyWindowInsetsListener(
                    findViewById(R.id.main), (v, insets) -> {
                          Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
                          v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
                          return insets;
                    });
            btn_login = findViewById(R.id.btn_login);
            btn_reg = findViewById(R.id.btn_regsiter);

            btn_login.setOnClickListener(new View.OnClickListener()
            {
                  @Override
                  public void onClick(View v)
                  {
                        Intent intent = new Intent(xiguaActivity.this, XGLoginActivity.class);
                        startActivity(intent);
                  }
            });

            btn_reg.setOnClickListener(new View.OnClickListener()
            {
                  @Override
                  public void onClick(View v)
                  {
                        Intent intent = new Intent(xiguaActivity.this, RegisterActivity.class);
                        startActivity(intent);
                  }
            });

      }
}